<!DOCTYPE html>
<html>
  <head>
    <title>CodeCompass</title>

    <meta charset="UTF-8">

    <link rel="shortcut icon" href="images/favicon.ico" />

    <!-- CSS -->

    <link rel="stylesheet" href="scripts/node_modules/codemirror/lib/codemirror.css" />
    <link rel="stylesheet" href="scripts/node_modules/codemirror/addon/dialog/dialog.css" />
    <link rel="stylesheet" href="scripts/node_modules/codemirror/addon/fold/foldgutter.css" />
    <link rel="stylesheet" href="scripts/release/dojo/resources/dojo.css" />
    <link rel="stylesheet" href="scripts/release/dijit/themes/claro/claro.css"/>
    <link rel="stylesheet" href="scripts/release/dojox/layout/resources/ResizeHandle.css" />
    <link rel="stylesheet" href="scripts/release/dojox/layout/resources/FloatingPane.css" />
    <link rel="stylesheet" href="scripts/release/dojox/image/resources/Lightbox.css" />
    <link rel="stylesheet" href="scripts/release/dojox/grid/resources/claroGrid.css" />

    <!-- Third party libraries -->

    <script type="text/javascript" src="scripts/thrift.js"></script>
    <script type="text/javascript" src="scripts/node_modules/codemirror/lib/codemirror.js"></script>
    <script type="text/javascript" src="scripts/node_modules/codemirror/mode/clike/clike.js"></script>
    <script type="text/javascript" src="scripts/node_modules/codemirror/mode/erlang/erlang.js"></script>
    <script type="text/javascript" src="scripts/node_modules/codemirror/mode/javascript/javascript.js"></script>
    <script type="text/javascript" src="scripts/node_modules/codemirror/mode/perl/perl.js"></script>
    <script type="text/javascript" src="scripts/node_modules/codemirror/mode/python/python.js"></script>
    <script type="text/javascript" src="scripts/node_modules/codemirror/mode/ruby/ruby.js"></script>
    <script type="text/javascript" src="scripts/node_modules/codemirror/mode/sql/sql.js"></script>
    <script type="text/javascript" src="scripts/node_modules/codemirror/mode/diff/diff.js"></script>
    <script type="text/javascript" src="scripts/node_modules/codemirror/addon/dialog/dialog.js"></script>
    <script type="text/javascript" src="scripts/node_modules/codemirror/addon/search/search.js"></script>
    <script type="text/javascript" src="scripts/node_modules/codemirror/addon/search/searchcursor.js"></script>
    <script type="text/javascript" src="scripts/node_modules/codemirror/addon/edit/matchbrackets.js"></script>
    <script type="text/javascript" src="scripts/node_modules/codemirror/addon/fold/foldcode.js"></script>
    <script type="text/javascript" src="scripts/node_modules/codemirror/addon/fold/foldgutter.js"></script>
    <script type="text/javascript" src="scripts/node_modules/codemirror/addon/fold/brace-fold.js"></script>
    <script type="text/javascript" src="scripts/node_modules/codemirror/addon/fold/xml-fold.js"></script>
    <script type="text/javascript" src="scripts/node_modules/jquery/dist/jquery.min.js"></script>
    <script type="text/javascript" src="scripts/node_modules/jsplumb/dist/js/jsplumb.min.js"></script>
    <script type="text/javascript" src="scripts/node_modules/svg-pan-zoom/dist/svg-pan-zoom.min.js"></script>
    <script type="text/javascript" src="scripts/node_modules/marked/marked.min.js"></script>
    <script type="text/javascript" src="scripts/node_modules/d3/d3.min.js"></script>
    <script type="text/javascript" src="scripts/node_modules/js-cookie/src/js.cookie.js"></script>

    <script type="text/javascript">
      if (Cookies.get('dojo-cache') === undefined) {
        Cookies.set('dojo-cache', Date.now(), { expires: 7 });
      }

      var dojoConfig = {
        baseUrl: 'scripts/release/',
        tlmSiblingOfDojo: false,
        defaultDuration: 1,
        async: true,
        cacheBust: Cookies.get('dojo-cache'),
        packages: [
          { name: 'dojo',  location: 'dojo'  },
          { name: 'dijit', location: 'dijit' },
          { name: 'dojox', location: 'dojox' },
          { name: 'codecompass', location: 'codecompass' }
        ]
      };
    </script>

    <script type="text/javascript" src="scripts/release/dojo/dojo.js"></script>

    <script type="text/javascript">
      var commonModules = [
        'scripts/codecompass/generated/authentication_types.js',
        'scripts/codecompass/generated/AuthenticationService.js',
        'scripts/codecompass/generated/common_types.js',
        'scripts/codecompass/generated/project_types.js',
        'scripts/codecompass/generated/ProjectService.js',
        'scripts/codecompass/generated/language_types.js',
        'scripts/codecompass/generated/LanguageService.js',
        'scripts/codecompass/generated/plugin_types.js',
        'scripts/codecompass/generated/PluginService.js',
        'scripts/codecompass/generated/workspace_types.js',
        'scripts/codecompass/generated/WorkspaceService.js'
      ];

      require(commonModules, function(){ // load common thrift modules
        require([
          'dojo/_base/array',
          'dojo/dom-construct',
          'codecompass/model'
        ], function(array, domConstruct, model){
          var css = model.plugin.getWebStylePlugins();
          array.forEach(css, function(file){
            domConstruct.create("link", {
              rel  :'stylesheet',
              type :'text/css',
              href : file,
            }, document.getElementsByTagName('head')[0]);
          });

          var thriftModules = model.plugin.getThriftPlugins();
          var diffModules = array.filter(thriftModules, function(module){
            return commonModules.indexOf(module) < 0;
          });
          require(diffModules, function() { // load plugin thrift modules
            require(['scripts/release/codecompass/bundle.js'], function() { // load codecompass bundle
              var webModules = model.plugin.getWebPlugins();
              require(webModules, function() { // load any module not in bundle
                require([
                  'codecompass/codecompass',
                  'dojo/domReady!'
                ], function (codecompass) {
                  codecompass();
                });
              });
            });
          });
        });
      });
    </script>

    <!-- Google Analytics (optionally loaded!) -->
    <script type="text/javascript" src="scripts/ga.js"></script>
  </head>
  <body class="claro">
  </body>
</html>
